{% load thumbnail %}

<li class="{% if game.has_installer %} with-installer{% endif %}">

  <div class="game-image">
    {% if not game.change_for %}
      <a href="{{ game.get_absolute_url }}">
        <img class='game-cover' src="{{ game.banner_url }}" alt="{{ game.name }}"/>
      </a>
    {% else %}
      <img src="{{ game.change_for.banner_url }}" alt="{{ game.change_for.name }}"/>
    {% endif %}
  </div>

  <div class="game-info">

    <a href="{{ game.get_absolute_url }}"
        title="{{ game.name }}"
        class="game-title">{{ game.name }}</a>

    {% if is_library %}
      <a title="Remove from Library" href="{% url 'remove_from_library' slug=game.slug %}" class="right-button">
        <i class="fas fa-trash-alt"></i>
      </a>
    {% endif %}

    <div class="game-meta">
      <span>
      平台:
      {% for platform in game.platforms.all %}
        <a href="{% url 'games_by_platform' platform=platform.pk %}" class="filter-link">{{ platform }}</a>
      {% endfor %}
      </span>
      {% if game.developer %}
        <span>
        开发商: <a href="{% url 'games_by_company' company=game.developer.pk %}" class="filter-link">{{ game.developer }}</a>
        </span>
      {% endif %}

      {% if game.publisher %}
      <span>
        发行商: <a href="{% url 'games_by_company' company=game.publisher.pk %}" class="filter-link">{{ game.publisher }}</a>
      </span>
      {% endif %}
      <br>
      <span>
      类型:
      {% for genre in game.genres.all %}
        <a href="{% url 'games_by_genre' genre=genre.pk %}" class="filter-link">{{ genre }}</a>
      {% endfor %}
      </span>

      {% if game.year %}
        <span>
          发行年份: <a href="{% url 'games_by_year' year=game.year %}" class="filter-link">{{ game.year }}</a>
        </span>
      {% endif %}
      <br>
    </div>
  </div>

</li>
